package com.fesine.learn.design.pattern.creational.prototype;

/**
 * @description: 类描述
 * @author: fesine
 * @createTime:2019/4/13
 * @update:修改内容
 * @author: fesine
 * @updateTime:2019/4/13
 */
public class Test {
    public static void main(String[] args) throws CloneNotSupportedException {
        Mail mail = new Mail();
        mail.setContent("邮件模板");
        System.out.println("初始化mail："+mail);
        for (int i = 0; i < 10; i++) {
            Mail mailTemp = (Mail) mail.clone();
            System.out.println("克隆的mail："+mailTemp);
            mailTemp.setName("姓名" + i);
            mailTemp.setMailAddress("姓名"+i+"@dap.com");
            mailTemp.setContent("感谢您在研发中突出贡献！");
            MailUtil.sendMail(mailTemp);
        }
        MailUtil.saveOriginMailRecord(mail);
    }
}
